<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: acer
  Date: 2020/12/17
  Time: 14:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page session="true"%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>查看发帖</title>
</head>

<body>
<%@ include file="banner.jsp" %>
<table style="margin-left:20%">
    <thead>
    <tr style="height: 50px;">
        <th style="width: 330px" align="center">主题</th>
        <th style="width: 250px" align="center">发帖时间</th>
        <th style="width: 150px" align="center">点击量</th>
        <th style="width: 80px" align="center"></th>>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${paginationSupport.items}" var="post" varStatus="li">
        <tr style="height: 50px;">
            <th width="80" align="center"><a href="<c:url value="/post/${post.postID}" />">${post.topic}</a></th>
            <td width="80" align="center">${post.postedTime}</td>
            <td width="80" align="center">${post.clickCount}</td>
            <td width="80" align="center"><a href="<c:url value="/post/modifyPost/${post.postID}" />">重新编辑</a></td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<p style="margin-left:20%">
每页${paginationSupport.pageSize}条帖子，
第${paginationSupport.currentPageNo}/${paginationSupport.totalPageCount}页,共${paginationSupport.totalCount}条帖子
</p>
<c:if test="${paginationSupport.previousPage}">
    <a href="<c:url value="/post/myPost?pageNo=${paginationSupport.currentPageNo-1}" />">上一页</a>
</c:if>
<c:if test="${paginationSupport.nextPage}">
    <a href="<c:url value="/post/myPost?pageNo=${paginationSupport.currentPageNo+1}" />">下一页</a>
</c:if>
<br>
<br>
<a href="<c:url value="/" />">返回</a>
</body>
</html>